package day7;

/**
 * @author oldliu
 * @since 1.0
 */
public class Teshuzhishu {
    public static void main(String[] args) {
        long start = 1L;
        int i = 0;
        long k;
        while (++i < 64) {
            k = start - 1;
            if (isPrime(k)) {
                System.out.println(k);
            }
            start = start << 1;//start*=2;
//            if (start >= 100000000)
//                break;
        }
    }

    //质数
    private static boolean isPrime(long n) {
        if (n <= 1) {
            return false;
        }
        if (n == 2) {
            return true;
        }
        for (long i = 2, k = (int) Math.sqrt(n); i <= k; i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }
}
